SLASH_CCR1 = "/ccr"
function SlashCmdList.CCR(msg, editbox)
	local command, rest = msg:match("^(%S*)%s*(.-)$");
	command = string.lower(command);
  if command == "gui" then ccR.GUI.Toggle() end
  if command == "start" then ccR.Rotation.Start() end
  if command == "stop" then ccR.Rotation.Stop() end
end

SLASH_CCRRL1 = "/rl"
function SlashCmdList.CCRRL(msg, editbox)
	ReloadUI();
end

SLASH_CCRSCR1 = "/scr"
function SlashCmdList.CCRSCR(msg, editbox)
	RunMacroText("/script " .. msg)
end

SLASH_CCRSCP1 = "/scp"
function SlashCmdList.CCRSCP(msg, editbox)
	RunMacroText("/script print(" .. msg .. ")")
end

function split(pString, pPattern)
   local Table = {}  -- NOTE: use {n = 0} in Lua-5.0
   local fpat = "(.-)" .. pPattern
   local last_end = 1
   local s, e, cap = pString:find(fpat, 1)
   while s do
          if s ~= 1 or cap ~= "" then
--         table.insert(Table,cap)
         Table[#Table+1]=cap
          end
          last_end = e+1
          s, e, cap = pString:find(fpat, last_end)
   end
   if last_end <= #pString then
          cap = pString:sub(last_end)
--          table.insert(Table, cap)
          Table[#Table+1]= cap
   end
   return Table
end